export default class menu extends Laya.Script {
    /** @prop {name:startBtn, tips:"开始按钮", type:Node}*/
    public startBtn: Laya.Node;
    /** @prop {name:aboutBtn, tips:"关于按钮", type:Node}*/
    public aboutBtn: Laya.Node;
    /** @prop {name:aboutDialog, tips:"关于弹窗", type:Node}*/
    public aboutDialog: Laya.Node;
    // 更多参数说明请访问: https://ldc2.layabox.com/doc/?nav=zh-as-2-4-0

    constructor() { super(); }

    onAwake(): void {
     
        this.aboutBtn.on(Laya.Event.MOUSE_DOWN, this, () => {
            /* 关于游戏 */
            (this.aboutDialog as Laya.Dialog).visible = true;
            (this.aboutDialog as Laya.Dialog).open();
        })
        let closeBtn = this.aboutDialog.getChildByName("spriteBG").getChildByName("closeAboutBtn");
        closeBtn.on(Laya.Event.MOUSE_DOWN, this, () => {
            /* 关闭 */
            (this.aboutDialog as Laya.Dialog).close();
        })
    }
    onEnable(): void {
        (this.aboutDialog as Laya.Dialog).visible = false; // 隐藏弹出框
        this.startBtn.on(Laya.Event.MOUSE_DOWN, this, () => {
            /* 跳转到游戏页面 */
            Laya.Scene.open("main.scene");
        });
     
    }

    onDisable(): void {
    }
}